package ui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.miginfocom.swing.MigLayout;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class add_topic extends JFrame {

	private JPanel contentPane;
	private JTextField txtTopicName;
	private JTextField txtImageUrl;
	private JTextField txtDescription;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					add_topic frame = new add_topic();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public add_topic() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 400);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new MigLayout("", "[grow]", "[][][][]"));
		
		txtTopicName = new JTextField();
		txtTopicName.setText("Topic Name");
		contentPane.add(txtTopicName, "cell 0 0,growx");
		txtTopicName.setColumns(10);
		
		txtImageUrl = new JTextField();
		txtImageUrl.setText("Image URL");
		contentPane.add(txtImageUrl, "cell 0 1,growx");
		txtImageUrl.setColumns(10);
		
		txtDescription = new JTextField();
		txtDescription.setText("Description");
		contentPane.add(txtDescription, "cell 0 2,growx");
		txtDescription.setColumns(10);
		
		JButton btnNewButton = new JButton("Add Topic");
		btnNewButton.addMouseListener(new MouseAdapter() {
			//Handles adding a new topic
			@Override
			public void mouseClicked(MouseEvent e) {
			}
		});
		contentPane.add(btnNewButton, "cell 0 3,alignx right");
	}

}
